package com.guixiansong.rabbitmq;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import org.junit.Test;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

public class Provider {
    @Test
    public void testSendMessage() throws IOException, TimeoutException {
        Before before = new Before();
        Channel channel=before.channel;

        //发布消息
        //参数一：交换机名称
        //参数二：队列名称
        //参数三：传递消息额外设置
        //参数四：消息的具体内容
        channel.basicPublish("","hello",null,"hello rabbitmq guixiansong!".getBytes());

        before.close();
    }
}
